package org.openclinic.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "reminder", schema = "public")
public class Reminder implements java.io.Serializable {

	private static final long serialVersionUID = 2606688677153595286L;
	
	private Long reminderId;
	
	private Customer customer;
	
	private Attendant attendant;
	
	private String description;
	
	private boolean important;
	
	private Date expireDate;
	
	private Date creationDate;

	public Reminder() {
	}

	public Reminder(Long reminderId, Customer customer, Attendant attendant, String description,
			boolean important, Date creationDate) {
		this.reminderId = reminderId;
		this.customer = customer;
		this.attendant = attendant;
		this.description = description;
		this.important = important;
		this.creationDate = creationDate;
	}

	public Reminder(Long reminderId, Customer customer, Attendant attendant, String description,
			boolean important, Date expireDate, Date creationDate) {
		this.reminderId = reminderId;
		this.customer = customer;
		this.attendant = attendant;
		this.description = description;
		this.important = important;
		this.expireDate = expireDate;
		this.creationDate = creationDate;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "reminder_id", unique = true, nullable = false)
	public Long getReminderId() {
		return this.reminderId;
	}

	public void setReminderId(Long reminderId) {
		this.reminderId = reminderId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "customer_id", nullable = false)
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "attendant_id", nullable = false)
	public Attendant getAttendant() {
		return this.attendant;
	}

	public void setAttendant(Attendant attendant) {
		this.attendant = attendant;
	}

	@Column(name = "description", nullable = false, length = 2000)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "important", nullable = false)
	public boolean isImportant() {
		return this.important;
	}

	public void setImportant(boolean important) {
		this.important = important;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "expire_date", length = 13)
	public Date getExpireDate() {
		return this.expireDate;
	}

	public void setExpireDate(Date expireDate) {
		this.expireDate = expireDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "creation_date", nullable = false, length = 13)
	public Date getCreationDate() {
		return this.creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

}
